package cn.passlink.bletoothchat.mActivity;

import androidx.appcompat.app.AppCompatActivity;

import android.content.Context;
import android.content.Intent;
import android.database.sqlite.SQLiteDatabase;
import android.os.Bundle;
import android.view.View;
import android.widget.ImageView;
import android.widget.ListView;
import android.widget.TextView;

import java.util.ArrayList;
import java.util.List;

import cn.passlink.bletoothchat.Adapter.FriendsAdapter;
import cn.passlink.bletoothchat.Adapter.SendMessageAdapter;
import cn.passlink.bletoothchat.Entity.Friends;
import cn.passlink.bletoothchat.Entity.SendMessage;
import cn.passlink.bletoothchat.R;
import cn.passlink.bletoothchat.SqlTables.FriendsTableManager;
import cn.passlink.bletoothchat.SqlTables.MyDatabaseHelper;

public class GroupMembersActivity extends AppCompatActivity {
    private SQLiteDatabase database;
    private MyDatabaseHelper databaseHelper;
    private Context mcontext;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_group_members);
        ListView listView = findViewById(R.id.show_group_members_listview);
        ImageView backButton = findViewById(R.id.menbers_group_back_button);
        ImageView memberButton = findViewById(R.id.menbers_add_group_button);



        backButton.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                goToTargetActivity(GroupTalkingActivity.class);

            }

        });
        memberButton.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                goToTargetActivity(RelationshipActivity.class);

            }

        });

        List<Friends> friendsList = new ArrayList<Friends>();
        Friends mFr=new Friends();
        mFr.setClasses("fr");
        mFr.setAcademy("d");
        mFr.setPhone("fd");
        mFr.setUsername("fd");
        mFr.setGrade("dfes");
        friendsList.add(mFr);
        FriendsAdapter adapter = new FriendsAdapter(this,friendsList);

        // 设置适配器
        listView.setAdapter(adapter);

    }



    public void goToTargetActivity(Class gotoActivity) {
        Intent intent = new Intent(this, gotoActivity);
        startActivity(intent);
    }


}